package com.wing.cabinet.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.bill.model.response.MaterialCheckStatisticsVO;
import com.wing.cabinet.model.entity.CheckedResult;
import com.wing.cabinet.model.request.CheckedResultForm;
import com.wing.cabinet.model.response.CheckedResultVO;
import com.wing.cabinet.model.response.CheckedScrapVO;
import com.wing.cabinet.model.response.InspectionAndRepairExportVO;
import com.wing.common.utils.JsonResult;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 盘验结果表-Service
 *
 * @author
 */
public interface CheckedResultService extends IService<CheckedResult> {

    /**
     * 添加
     *
     * @param checkedResultForm
     * @return
     */
    int add(CheckedResultForm checkedResultForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<CheckedResultVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<CheckedResultVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    CheckedResultVO get4appById(Long id);

    int updateIsGenOrder(List<Long> idList);

    /**
     * 导出
     * @param params
     * @return
     */
    List<CheckedResultVO> exportList(Map<String, Object> params);

    List<InspectionAndRepairExportVO> getInspectionAndRepairExportVOList(Map<String, Object> params);

    List<CheckedScrapVO> getCheckedScrapVoExportList(Map<String, Object> params);

    Page<HashMap> getCabCodeGroupBy(Page page,String cabCode,String belongCabinet);

//    List<HashMap> getStatisticsByCabCode(String cabCode);

    List<HashMap> getDetailStatisticsByCabCode(String cabCode, Integer spaceCode,Integer businessType);

    Page<HashMap> getTaskGroupBy(Page page,String taskCode,String cabCode);

    /**
     * 物料盘验统计（按天）顶部折线图
     * @param params
     * @param days
     * @return
     */
    JsonResult topLineChart(Map<String, Object> params, Integer days);

    /**
     * 物料盘验数据统计
     * @param params
     * @return
     */
    JsonResult<MaterialCheckStatisticsVO> materialCheckStatistics(Map<String, Object> params);

    /**
     * 物料盘验结果（按物料）柱状图
     * @param params
     * @return
     */
    JsonResult materialCheckResult(Map<String, Object> params);

    /**
     * 物料盘验排名（按柜子）饼状图
     * @param params
     * @return
     */
    JsonResult materialCheckRankingPieChart(Map<String, Object> params);
}
